//封装请求方法
const myRequest = function (url, method, data, successCallback) {
  console.log("myRequest")
  //获取token
  const token = wx.getStorageSync("token");

  wx.request({
    url: url,
    method: method,
    data: data,
    header: {
      //请求头
      'content-type': 'application/json', //默认值
      'X-Nideshop-Token': token
    },
    //成功的回调，调用时传入
    success: successCallback
  })
};

export default myRequest;